<?php
/**
 * This file is form http://findcat.cn
 *
 * @author   犯二青年
 * @link     http://findcat.cn
 * @email    1476982312@qq.com
 */
namespace App\Domain\QueryList;

use QL\QueryList;

/**
 * Class QueryListUsecase.
 */
class QueryListUsecase
{
    /**
     * @var QueryList
     */
    private $queryList;

    /**
     * QueryListUsecase constructor.
     */
    public function __construct(QueryList $queryList)
    {
        $this->queryList = $queryList;
    }

    /**
     * 元素采集操作.
     *
     * @param $url
     * @param $label
     * @param $function
     *
     * @return \QL\Dom\Elements
     */
    public function elementsCrawle($url, $label, $function)
    {
        return $this->queryList->get($url)->find($label)->find($function);
    }
}
